Skip to content

Reject a deploy request without a version - #22

Merged
slominskir merged 1 commit into
mainfrom
null-version
Oct 1, 2026
Merged

slominskir merged 1 commit into
mainfrom
null-version

Conversation

@slominskir-coding-agent

Copy link
Copy Markdown
Contributor

Found while writing the tests in #21.

What changed

A deploy request without the ver parameter passed a null version to DeployerFacade.validateSemver, where Pattern.matcher(null) threw a NullPointerException. The Deploy servlet catches only UserFriendlyException and IOException, so the caller got an error page instead of the JSON response. Now a missing version is rejected like any other non-semver version, with {"exception": "Version string must be semver formatted"}.

DeployerFacadeTest.nonSemverIsRejected now also covers a null version.

Checks

  • Without the fix, the new test case fails with the NullPointerException.
  • With it, ./gradlew spotlessCheck build passes (33 tests, in the gradle:9-jdk21 container).

Not checked: requests without env or app. Those go to AppEnvFacade.find as null names. I'd expect the query to find nothing and return "AppEnv not found", but that needs the database to confirm.

🤖 Generated with Claude Code

A request without the ver parameter passed a null version to
validateSemver, where Pattern.matcher(null) threw a
NullPointerException. The deploy servlet then failed with an error
page instead of its JSON response. Treat a missing version like any
other non-semver version, so the caller gets "Version string must be
semver formatted".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slominskir-coding-agent slominskir-coding-agent Bot added the bug Something isn't working label Oct 1, 2026
@slominskir-coding-agent slominskir-coding-agent Bot added the bug Something isn't working label Oct 1, 2026
@slominskir
slominskir merged commit cd5aa4d into main Oct 1, 2026
5 checks passed
@slominskir
slominskir deleted the null-version branch October 1, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant